﻿using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Web.Api.Server.Models
{
    [Table(Name = "Addresses")]
    public class Address
    {
        [Column(Name = "id", IsIdentity = true)]
        public int Id { get; set; }

        [Column(Name = "contact", StringLength = 255)]
        public string Contact { get; set; }

        [Column(Name = "mobile", StringLength = 255)]
        public string Mobile { get; set; }

        [Column(Name = "addr", StringLength = 255)]
        public string Addr { get; set; }

        [Column(Name = "is_default")]
        public bool IsDefault { get; set; } = true;

        [Column(Name = "user_id")]
        public int UserId { get; set; }

        [Column(Name = "created_at", IsNullable = true)]
        public DateTime? CreatedAt { get; set; } = DateTime.Now;

        [Column(Name = "updated_at", IsNullable = true)]
        public DateTime? UpdatedAt { get; set; } = DateTime.Now;
    }
}
